package com.qf.springcloud.client;

import com.qf.springcloud.client.factory.ProviderClientFallbackFactory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * 将当前interface映射上PROVIDER服务
 * @author zjw
 */
@FeignClient(value = "PROVIDER",fallbackFactory = ProviderClientFallbackFactory.class)
public interface ProviderClient {


    /**
     * 映射方法参数和方法返回结果，与方法名无关。    基于SpringMVC注解和服务的接口路径做映射
     * @return
     */
    @GetMapping("/provider/test")
    public String test();

    @GetMapping("/provider/test1/{id}")
    public String test1(@PathVariable(value = "id") String id);

    @GetMapping("/provider/test2")
    public String test2(@RequestParam(value = "name")  String name,@RequestParam(value = "age") Integer age);

    @GetMapping("/provider/test3")
    public Map test3(Map map);


}
